package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LN on 2018/1/8
 */
@Entity
@DynamicInsert
@Table(name = "sign_in_award_draw_detail")
public class SignInAwardDrawDetailEntity extends BaseEntity{
    private String memberNo;
    private Date month;
    private String awardCode;
    private String hasDrawn;
    private String activityCode;

    @Basic
    @Column(name = "member_no")
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @Column(name = "month")
    public Date getMonth() {
        return month;
    }

    public void setMonth(Date month) {
        this.month = month;
    }

    @Basic
    @Column(name = "award_code")
    public String getAwardCode() {
        return awardCode;
    }

    public void setAwardCode(String awardCodo) {
        this.awardCode = awardCodo;
    }

    @Basic
    @Column(name = "has_drawn")
    public String getHasDrawn() {
        return hasDrawn;
    }

    public void setHasDrawn(String isDrawn) {
        this.hasDrawn = isDrawn;
    }

    @Basic
    @Column(name = "activity_code")
    public String getActivityCode() {
        return activityCode;
    }

    public void setActivityCode(String activityCode) {
        this.activityCode = activityCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SignInAwardDrawDetailEntity that = (SignInAwardDrawDetailEntity) o;

        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        if (month != null ? !month.equals(that.month) : that.month != null) return false;
        if (awardCode != null ? !awardCode.equals(that.awardCode) : that.awardCode != null) return false;
        if (hasDrawn != null ? !hasDrawn.equals(that.hasDrawn) : that.hasDrawn != null) return false;
        return activityCode != null ? activityCode.equals(that.activityCode) : that.activityCode == null;
    }

    @Override
    public int hashCode() {
        int result = memberNo != null ? memberNo.hashCode() : 0;
        result = 31 * result + (month != null ? month.hashCode() : 0);
        result = 31 * result + (awardCode != null ? awardCode.hashCode() : 0);
        result = 31 * result + (hasDrawn != null ? hasDrawn.hashCode() : 0);
        result = 31 * result + (activityCode != null ? activityCode.hashCode() : 0);
        return result;
    }
}
